package com.kwq.designPattern.exam;

import java.util.*;

/**
 * @author kangwanqiang
 * @date 2021/3/13
 * @description 美团春招笔试
 */
public class MeiTuan {
    private static List<Integer> findNums(String str) {
        List<Integer> res = new ArrayList<>();
        StringBuilder stringBuilder = new StringBuilder();
        for (char c : str.toCharArray()) {
            if (c >= '0' && c <= '9') {
                stringBuilder.append(c);
            } else {
                if (stringBuilder.length() > 0) {
                    res.add(Integer.valueOf(stringBuilder.toString()));
                    stringBuilder.setLength(0);
                }
            }
        }
        return res;
    }


    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputs = scanner.next();
        List<Integer> nums = findNums(inputs);
        Collections.sort(nums);
        for (Integer num : nums) {
            System.out.println(num);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int nums = scanner.nextInt();
        int len = scanner.nextInt();
        int[] arr = new int[nums];
        for (int i = 0; i < nums; i++) {
            arr[i] = scanner.nextInt();
        }
        Map<Integer, Integer> map = new HashMap<>();
        int min = Integer.MAX_VALUE;
        int mass = min;
        int start = 0;
        int end = 0;
        while (end < nums) {
            if (end - start < len - 1) {
                map.put(arr[end], map.getOrDefault(arr[end], 0) + 1);
                end++;
            } else {

            }
        }
    }
}
